<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>商品购买</title>
    <style>
        img{
            width: 150px;
            height:150px;
        }
    </style>
</head>
<body>
    <div id="book">
        <img src="../images/1.bmp" alt="">
        <p>Javascript高级开发指南</p>
        <p>56.5</p>
    </div>
    <script>
        let book = document.getElementById("book");
        book.onclick = function(e){
            console.log("购买书籍",e.target,this);
        }
    </script>
</body>
</html>